def main():
    try:
        with open('text.jpg', 'rb') as fs:
            data = fs.read()
            print(type(data))
        with open('ji.jpg', 'wb') as fs2:
            fs2.write(data)
    except FileNotFoundError as e:
        print(e)
    except IOError as io:
        print(io)
    
    print('程序执行结束')


if __name__ == "__main__":
    main()
